import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

function getRoutes(): Array<RouteRecordRaw> {
  return [
    {
      path: '/Home',
      name: '首页',
      component: () => import('@/views/Home.vue'),
      children: [
        {
          path: '/view',
          name: '视图',
          component: () => import('@/views/View.vue')
        },
        {
          path: '/form',
          name: '表单',
          component: () => import('@/views/Form.vue')
        },
        {
          path: '/test',
          name: '测试',
          component: () => import('@/views/Test.vue')
        },
        {
          path: '/table',
          name: '表',
          component: () => import('@/views/base/entity/index.vue')
        }
      ]
    }
  ]
}

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes: getRoutes()
})

export default router
